import unittest
import logging.handlers
import logging
import time


# 定义测试类tpshop登录
from api.py_01_test import Tp_shopapi


class Tpshoplogin(unittest.TestCase):
    # 定义一个方法
    def test01_login_ok(self):
        # 书写登录里面需要用到的data数据
        formdata = {"username": "15620928794", "password": "123456", "verify_code": "8888"}
        # 返回结果等于调用登录方法的登录功能(书写api的方法名,将其导入),将需要传的数据传到参数中
        resp = Tp_shopapi.login(formdata)
        print(resp.json())

    def test02_pwd_error(self):
        formdata = {"username": "15620928794", "password": "12345622", "verify_code": "8888"}
        resp = Tp_shopapi.login(formdata)
        print(resp.json())

    def test03_mobile_error(self):
        formdata = {"username": "15620928797", "password": "123456", "verify_code": "8888"}
        resp = Tp_shopapi.login(formdata)
        print(resp.json())
